import { BrowserModule } from '@angular/platform-browser';
import { NgModule, ModuleWithProviders } from '@angular/core';
import { FormsModule} from '@angular/forms';

import { AppComponent } from './app.component';
import { AllPeopleComponent } from './all-people/all-people.component';
import { LastLeaveComponent } from './last-leave/last-leave.component';
import { FirstComeComponent } from './first-come/first-come.component';

//在根模块中引入路由模块
import { rootRouterConfig } from './app.routes'; //注意没有.ts
//需要调用RouterModule.forRoot()方法
import { RouterModule } from '@angular/router';
import { PersonDetailComponent } from './person-detail/person-detail.component';

let rootRouterModule: ModuleWithProviders = RouterModule.forRoot(rootRouterConfig);
//根路由模块默认提供的路由策略为PathLocationStrategy（另外一个是HashLocationStrategy）。
//PathLocationStrategy路由策略需要一个base路径，设置base路径有2种方式，最简单的是在index.html中设置<base>

@NgModule({
  declarations: [
    AppComponent,
    AllPeopleComponent,
    LastLeaveComponent,
    FirstComeComponent,
    PersonDetailComponent
  ],
  imports: [
    BrowserModule, rootRouterModule, FormsModule
  ],
  providers: [],
  bootstrap: [AppComponent]
})
export class AppModule { }
